package edu.wpi.cs509.messages.client;

import edu.wpi.cs509.clientlogic.ClientUpstreamLogic;
import edu.wpi.cs509.messages.MsgBc;
import edu.wpi.cs509.network.Connection;

/**
 * The base class for server->client messages.
 * 
 * @author mreiter
 */
public abstract class MsgClientContext extends MsgBc {
	/**
	 * The serialization version ID.
	 */
	private static final long serialVersionUID = 1L;
	
	/**
	 * Default constructor.
	 */
	public MsgClientContext(){}
	
	/**
	 * Used by the networking layer to set the connection after the 
	 * message has arrived.
	 * @param connection The connection on which the message arrived.
	 */
	@Override
	public void setConnection(Connection connection) {
		super.setConnection(connection);
	}
	
	/**
	 * @return The client session associated with the message.
	 */
	public ClientUpstreamLogic getCl() {
		return ClientUpstreamLogic.getInstance();
	}
	

}
